/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/firestore/v1/bloom_filter.proto

#include "google/firestore/v1/bloom_filter.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_BitSequence_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto;
namespace google {
namespace firestore {
namespace v1 {
class BitSequenceDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<BitSequence> _instance;
} _BitSequence_default_instance_;
class BloomFilterDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<BloomFilter> _instance;
} _BloomFilter_default_instance_;
}  // namespace v1
}  // namespace firestore
}  // namespace google
static void InitDefaultsscc_info_BitSequence_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::firestore::v1::_BitSequence_default_instance_;
    new (ptr) ::google::firestore::v1::BitSequence();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::firestore::v1::BitSequence::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_BitSequence_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_BitSequence_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto}, {}};

static void InitDefaultsscc_info_BloomFilter_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::firestore::v1::_BloomFilter_default_instance_;
    new (ptr) ::google::firestore::v1::BloomFilter();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::firestore::v1::BloomFilter::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_BloomFilter_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_BloomFilter_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto}, {
      &scc_info_BitSequence_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto.base,}};

static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto[2];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto = nullptr;

const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::BitSequence, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::BitSequence, bitmap_),
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::BitSequence, padding_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::BloomFilter, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::BloomFilter, bits_),
  PROTOBUF_FIELD_OFFSET(::google::firestore::v1::BloomFilter, hash_count_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, sizeof(::google::firestore::v1::BitSequence)},
  { 7, -1, sizeof(::google::firestore::v1::BloomFilter)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_BitSequence_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_BloomFilter_default_instance_),
};

const char descriptor_table_protodef_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n&google/firestore/v1/bloom_filter.proto"
  "\022\023google.firestore.v1\".\n\013BitSequence\022\016\n\006"
  "bitmap\030\001 \001(\014\022\017\n\007padding\030\002 \001(\005\"Q\n\013BloomFi"
  "lter\022.\n\004bits\030\001 \001(\0132 .google.firestore.v1"
  ".BitSequence\022\022\n\nhash_count\030\002 \001(\005B\311\001\n\027com"
  ".google.firestore.v1B\020BloomFilterProtoP\001"
  "Z<google.golang.org/genproto/googleapis/"
  "firestore/v1;firestore\242\002\004GCFS\252\002\031Google.C"
  "loud.Firestore.V1\312\002\031Google\\Cloud\\Firesto"
  "re\\V1\352\002\034Google::Cloud::Firestore::V1b\006pr"
  "oto3"
  ;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto_deps[1] = {
};
static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto_sccs[2] = {
  &scc_info_BitSequence_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto.base,
  &scc_info_BloomFilter_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto.base,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto_once;
static bool descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto_initialized = false;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto = {
  &descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto_initialized, descriptor_table_protodef_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto, "google/firestore/v1/bloom_filter.proto", 404,
  &descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto_once, descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto_sccs, descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto_deps, 2, 0,
  schemas, file_default_instances, TableStruct_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto::offsets,
  file_level_metadata_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto, 2, file_level_enum_descriptors_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto, file_level_service_descriptors_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto,
};

// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto = (  ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto), true);
namespace google {
namespace firestore {
namespace v1 {

// ===================================================================

void BitSequence::InitAsDefaultInstance() {
}
class BitSequence::_Internal {
 public:
};

BitSequence::BitSequence()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.firestore.v1.BitSequence)
}
BitSequence::BitSequence(const BitSequence& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  bitmap_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (!from._internal_bitmap().empty()) {
    bitmap_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.bitmap_);
  }
  padding_ = from.padding_;
  // @@protoc_insertion_point(copy_constructor:google.firestore.v1.BitSequence)
}

void BitSequence::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_BitSequence_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto.base);
  bitmap_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  padding_ = 0;
}

BitSequence::~BitSequence() {
  // @@protoc_insertion_point(destructor:google.firestore.v1.BitSequence)
  SharedDtor();
}

void BitSequence::SharedDtor() {
  bitmap_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void BitSequence::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const BitSequence& BitSequence::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_BitSequence_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto.base);
  return *internal_default_instance();
}


void BitSequence::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.BitSequence)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  bitmap_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  padding_ = 0;
  _internal_metadata_.Clear();
}

const char* BitSequence::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // bytes bitmap = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          auto str = _internal_mutable_bitmap();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // int32 padding = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          padding_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* BitSequence::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.BitSequence)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // bytes bitmap = 1;
  if (this->bitmap().size() > 0) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_bitmap(), target);
  }

  // int32 padding = 2;
  if (this->padding() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_padding(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.BitSequence)
  return target;
}

size_t BitSequence::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.BitSequence)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // bytes bitmap = 1;
  if (this->bitmap().size() > 0) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_bitmap());
  }

  // int32 padding = 2;
  if (this->padding() != 0) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
        this->_internal_padding());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void BitSequence::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.BitSequence)
  GOOGLE_DCHECK_NE(&from, this);
  const BitSequence* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<BitSequence>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.BitSequence)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.BitSequence)
    MergeFrom(*source);
  }
}

void BitSequence::MergeFrom(const BitSequence& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.BitSequence)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.bitmap().size() > 0) {

    bitmap_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.bitmap_);
  }
  if (from.padding() != 0) {
    _internal_set_padding(from._internal_padding());
  }
}

void BitSequence::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.BitSequence)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void BitSequence::CopyFrom(const BitSequence& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.BitSequence)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool BitSequence::IsInitialized() const {
  return true;
}

void BitSequence::InternalSwap(BitSequence* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  bitmap_.Swap(&other->bitmap_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(padding_, other->padding_);
}

::PROTOBUF_NAMESPACE_ID::Metadata BitSequence::GetMetadata() const {
  return GetMetadataStatic();
}


// ===================================================================

void BloomFilter::InitAsDefaultInstance() {
  ::google::firestore::v1::_BloomFilter_default_instance_._instance.get_mutable()->bits_ = const_cast< ::google::firestore::v1::BitSequence*>(
      ::google::firestore::v1::BitSequence::internal_default_instance());
}
class BloomFilter::_Internal {
 public:
  static const ::google::firestore::v1::BitSequence& bits(const BloomFilter* msg);
};

const ::google::firestore::v1::BitSequence&
BloomFilter::_Internal::bits(const BloomFilter* msg) {
  return *msg->bits_;
}
BloomFilter::BloomFilter()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.firestore.v1.BloomFilter)
}
BloomFilter::BloomFilter(const BloomFilter& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  if (from._internal_has_bits()) {
    bits_ = new ::google::firestore::v1::BitSequence(*from.bits_);
  } else {
    bits_ = nullptr;
  }
  hash_count_ = from.hash_count_;
  // @@protoc_insertion_point(copy_constructor:google.firestore.v1.BloomFilter)
}

void BloomFilter::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_BloomFilter_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto.base);
  ::memset(&bits_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&hash_count_) -
      reinterpret_cast<char*>(&bits_)) + sizeof(hash_count_));
}

BloomFilter::~BloomFilter() {
  // @@protoc_insertion_point(destructor:google.firestore.v1.BloomFilter)
  SharedDtor();
}

void BloomFilter::SharedDtor() {
  if (this != internal_default_instance()) delete bits_;
}

void BloomFilter::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const BloomFilter& BloomFilter::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_BloomFilter_google_2ffirestore_2fv1_2fbloom_5ffilter_2eproto.base);
  return *internal_default_instance();
}


void BloomFilter::Clear() {
// @@protoc_insertion_point(message_clear_start:google.firestore.v1.BloomFilter)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (GetArenaNoVirtual() == nullptr && bits_ != nullptr) {
    delete bits_;
  }
  bits_ = nullptr;
  hash_count_ = 0;
  _internal_metadata_.Clear();
}

const char* BloomFilter::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // .google.firestore.v1.BitSequence bits = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_bits(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // int32 hash_count = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          hash_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* BloomFilter::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.BloomFilter)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .google.firestore.v1.BitSequence bits = 1;
  if (this->has_bits()) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        1, _Internal::bits(this), target, stream);
  }

  // int32 hash_count = 2;
  if (this->hash_count() != 0) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_hash_count(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.BloomFilter)
  return target;
}

size_t BloomFilter::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.BloomFilter)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // .google.firestore.v1.BitSequence bits = 1;
  if (this->has_bits()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *bits_);
  }

  // int32 hash_count = 2;
  if (this->hash_count() != 0) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
        this->_internal_hash_count());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
        _internal_metadata_, total_size, &_cached_size_);
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void BloomFilter::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.BloomFilter)
  GOOGLE_DCHECK_NE(&from, this);
  const BloomFilter* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<BloomFilter>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.BloomFilter)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.BloomFilter)
    MergeFrom(*source);
  }
}

void BloomFilter::MergeFrom(const BloomFilter& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.BloomFilter)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.has_bits()) {
    _internal_mutable_bits()->::google::firestore::v1::BitSequence::MergeFrom(from._internal_bits());
  }
  if (from.hash_count() != 0) {
    _internal_set_hash_count(from._internal_hash_count());
  }
}

void BloomFilter::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.BloomFilter)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void BloomFilter::CopyFrom(const BloomFilter& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.BloomFilter)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool BloomFilter::IsInitialized() const {
  return true;
}

void BloomFilter::InternalSwap(BloomFilter* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(bits_, other->bits_);
  swap(hash_count_, other->hash_count_);
}

::PROTOBUF_NAMESPACE_ID::Metadata BloomFilter::GetMetadata() const {
  return GetMetadataStatic();
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace v1
}  // namespace firestore
}  // namespace google
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::google::firestore::v1::BitSequence* Arena::CreateMaybeMessage< ::google::firestore::v1::BitSequence >(Arena* arena) {
  return Arena::CreateInternal< ::google::firestore::v1::BitSequence >(arena);
}
template<> PROTOBUF_NOINLINE ::google::firestore::v1::BloomFilter* Arena::CreateMaybeMessage< ::google::firestore::v1::BloomFilter >(Arena* arena) {
  return Arena::CreateInternal< ::google::firestore::v1::BloomFilter >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
